
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #1a7bbc;
    --secondary-color: #4CAF50;
    --text-color: #333;
}

/* 头部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-placeholder {
    width: 150px;
    height: 50px;
    /* background: var(--primary-color); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'STXingkai', cursive;
    /* 应用华文行楷字体 */
    /* 应用草书字体 */
    font-size: 1.5rem;
    /* 调整字体大小 */
    color: rgb(45, 43, 43);
    /* 调整字体颜色 */
}


.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
}

/* 轮播图 */
.banner {
    height: 500px;
    position: relative;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s;
}

.banner-slide.active {
    opacity: 1;
}

.banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #8bc6ec 0%, #9599e2 100%);
}

/* 为 .banner-slide 内的 img 标签设置样式 */
.banner-slide img {
    width: 100%;
    height: auto; /* 保持图片比例 */
    object-fit: cover; /* 使图片填充容器，保持比例 */
}

/* 新增轮播控制样式 */
.banner-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 10;
}

.banner-arrow {
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.banner-arrow:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

/* 核心服务 */
.services {
    padding: 4rem 0;
    background: #f8f9fa;
}

.service-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.service-card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 特色科室 */
.departments {
    padding: 4rem 0;
}

.department-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

/* 特色科室部分的链接样式 */
.department-grid a {
    display: block;          /* 确保链接占据整个卡片区域 */
    text-decoration: none;   /* 移除下划线 */
    color: inherit;          /* 继承父元素颜色（避免默认蓝色） */
}


.department-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s; /* 添加过渡效果 */
}

.department-card:hover {
    transform: scale(1.05); /* 缩放效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* 阴影效果 */
}

.dept-placeholder {
    height: 200px;
    background-size: cover; /* 使图片覆盖整个背景 */
    background-position: center; /* 图片居中显示 */
    background-repeat: no-repeat; /* 防止图片重复 */
}

.card-content {
    padding: 1rem;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .department-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .banner {
        height: 300px;
    }

    .nav-right {
        flex-direction: column;
        margin-top: 1rem;
    }

    .logout-btn {
        width: 100%;
        text-align: center;
    }

    .service-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 新增样式 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logout-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: opacity 0.3s;
}

.logout-btn:hover {
    opacity: 0.9;
}

/* 新增图标定义 */
.fa-user-circle {
    color: #4CAF50;
}

/* 家人管理 */
.fa-clipboard-check {
    color: #FF9800;
}

/* 日常报备 */
.fa-clipboard-list {
    color: #9C27B0;
}

/* 预约管理 */
.fa-comments {
    color: #00BCD4;
}

/* 在线咨询 */
.fa-users {
    color: #E91E63;
}

/* 社区论坛 */

/* 新增颜色定义 */
.department-card:nth-child(3) .dept-placeholder {
    background: linear-gradient(45deg, #8A2BE2, #4B0082);
    /* 神经科紫色系 */
}

.department-card:nth-child(4) .dept-placeholder {
    background: linear-gradient(45deg, #00CED1, #20B2AA);
    /* 外科青绿系 */
}

.department-card:nth-child(5) .dept-placeholder {
    background: linear-gradient(45deg, #32CD32, #228B22);
    /* 内科绿色系 */
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .department-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* 添加卡片缩放与阴影效果 */
.service-card {
    transition: transform 0.3s, box-shadow 0.3s; /* 添加过渡效果 */
}

.service-card:hover {
    transform: scale(1.05); /* 缩放效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* 阴影效果 */
}

/* 确保链接占据整个卡片区域，实现点击任意地方均可跳转 */
.service-card a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none; /* 移除链接下划线 */
    color: inherit; /* 继承父元素颜色 */
}

/* 修改包裹卡片的链接样式 */
.service-grid a {
    display: block;          /* 确保链接占据整个卡片区域 */
    text-decoration: none;   /* 移除下划线 */
    color: inherit;          /* 继承父元素颜色（避免默认蓝色） */
}
